package com.neusoft.bizcore.auth.dto;

import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.auth.enums.AuthPermissionType;
import com.neusoft.bizcore.web.dto.AbstractDTO;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@ToString
public class AuthPermissionDTO extends AbstractDTO {

    private static final long serialVersionUID = 1L;

    /** 权限名 */
    @NotBlank(message = "权限名不能为空")
    @Length(max = 255, message = "权限名不能超过{max}位")
    private String name;

    /** 权限编码 */
    @NotBlank(message = "权限编码不能为空")
    @Length(max = 255, message = "权限编码不能超过{max}位")
    private String code;

    /** 权限类型 */
    @Enumerated(EnumType.STRING)
    @NotNull(message = " 权限类型不能为空")
    private AuthPermissionType type;

    private Long contentTypeId;
    private AuthContentTypeDTO contentType;

}
